<template>
	<view class="xp-wrap">
		<xc-uv-single-checkbox v-model="field.__answer__.value" @change="control_change"></xc-uv-single-checkbox>
	</view>
</template>

<script>
	import config from "@/config/config.js";
	import xcHttpUtils from '@/library/xcore/js/XcHttpUtils.js';
	import xcViewUtils from '@/library/xcore/js/XcViewUtils.js';
	import {
		xsStringUtils,
		xsDateUtils,
		xsArrayUtils
	} from 'xstack-for-javascript';

	export default {
		props: {
			field: {
				type: Object,
				default: []
			},
			paper: {
				type: Object,
				default: []
			},
		},
		watch: {
			'data': {
				handler(newVal, oldVal) {
					let that = this;
				},
			},
		},
		emits: ['change'],
		data() {
			return {
				checkboxValue: ['苹果'],
				config: config,
				xsStringUtils: xsStringUtils,
				xsDateUtils: xsDateUtils,
				sp: {},
				sr: {},
				control: {}
			}
		},
		created() {
			let that = this;
			that.xinit();
			that.public_show();
		},
		methods: {
			xinit() {
				let that = this;
			},
			public_show() {
				let that = this;
			},
			public_reset() {
				let that = this;
				that.public_show();
			},
			public_validate() {
				let that = this;
				let errmsg = null;

				return errmsg;
			},
			control_change() {
				let that = this;
				that.$emit("change");
				that.field.errmsg = that.public_validate();
			},
		}
	}
</script>

<style lang="scss">
	.xp-wrap{
		padding-left: $uni-spacing-row-base;
	}
</style>